Generic Point-free Lenses
نویسندگان
چکیده
Lenses are one the most popular approaches to define bidirectional transformations between data models. A bidirectional transformation with view-update, denoted a lens, encompasses the definition of a forward transformation projecting concrete models into abstract views, together with a backward transformation instructing how to translate an abstract view to an update over concrete models. In this paper we show that most of the standard point-free combinators can be lifted to lenses with suitable backward semantics, allowing us to use the point-free style to define powerful bidirectional transformations by composition. We also demonstrate how to define generic lenses over arbitrary inductive data types by lifting standard recursion patterns, like folds or unfolds. To exemplify the power of this approach, we “lensify” some standard functions over naturals and lists, which are tricky to define directly “by-hand” using explicit recursion.
منابع مشابه
Effect generic and non-generic feedback on Motor Learning basketball free throw in Children
Non-generic feedback refers to a specific event and that task performance is the reason to the acquisition of skills and implies that performance is malleable, while generic feedback implies that task performance reflects an inherent ability. The Goal of this study was to determine the generic and non-generic feedback effects on children’s motor learning basketball free throw. This research was...
متن کاملLight in Power: A General and Parameter-free Algorithm for Caustic Design
We present in this paper a generic and parameter-free algorithm to efficiently build a wide variety of optical components, such as mirrors or lenses, that satisfy some light energy constraints. In all of our problems, one is given a collimated or point light source and a desired illumination after reflection or refraction and the goal is to design the geometry of a mirror or lens which transpor...
متن کاملInvestigation of Liquefaction Mechanism in Double Sand Lenses
In many cases of heavy earthquakes, liquefaction has resulted in serious damages. Existing anisotropy in soil layers results in some difficulties to realize the reason for these phenomena. Loose sand lenses buried in fine soils are one of the cases which may result in these problems and as a weak point during the earthquake can cause this phenomenon. In this paper, using FLAC 2D software, doub...
متن کاملProbing the Structure of Lensing Galaxies with Quadruple Lenses: The Effect of the “External” Shear
We study a general elliptical potential of the form ψ(x + y/q) (0 < q ≤ 1) plus an additional shear (with an arbitrary direction) as models for the observed quadruple lenses. It is shown that a minimum additional shear is needed even just to reproduce the observed positions alone. We also obtain the dependence of the axial ratio, q, on the orientation of the major axis of potential. A general r...
متن کاملDelta Lenses over Inductive Types
Existing bidirectional languages are either state-based or operation-based, depending on whether they represent updates as mere states or as sequences of edit operations. In-between both worlds are delta-based frameworks, where updates are represented using alignment relationships between states. In this paper, we formalize delta lenses over inductive types using dependent type theory and devel...
متن کامل